CC=g++
TARGET = swarmBotOS
OFILES = swarmBotOS.o SwarmAlgorithm.o ClusterAlgorithm.o GroupByColorAlgorithm.o FLAlgorithm.o robotFunctions.o LED.o
CFLAGS = -I$(HOME)/csr-repository/include
LDFLAGS = -g -lperipherals -lfind_robots -lraspicamcv -lwiringPi -lcolor_thresholding -lopencv_highgui -lopencv_core -lopencv_legacy -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_imgproc -L/opt/vc/userland/build/lib -lmmal_core -lmmal -l mmal_util -lvcos -lbcm_host

all: swarmBotOS

swarmBotOS.o: swarmBotOS.cpp
	gcc -c -g swarmBotOS.cpp $(CFLAGS) -std=c++0x

SwarmAlgorithm.o: SwarmAlgorithm.cpp
	gcc -c -g SwarmAlgorithm.cpp $(CFLAGS)

ClusterAlgorithm.o: ./cluster/ClusterAlgorithm.cpp
	gcc -c -g ./cluster/ClusterAlgorithm.cpp $(CFLAGS)

GroupByColorAlgorithm.o: ./groupByColor/GroupByColorAlgorithm.cpp
	gcc -c -g ./groupByColor/GroupByColorAlgorithm.cpp $(CFLAGS)

FLAlgorithm.o: ./followTheLeader/FLAlgorithm.cpp
	gcc -c -g ./followTheLeader/FLAlgorithm.cpp $(CFLAGS)

robotFunctions.o: robotFunctions.cpp
	gcc -c -g robotFunctions.cpp $(CFLAGS)

LED.o: ../ControlLib/LED.cpp
	gcc -c -g ../ControlLib/LED.cpp $(CFLAGS)

swarmBotOS: $(OFILES)
	gcc -o swarmBotOS $(LDFLAGS) $(OFILES) /home/pi/csr-repository/CommunicationLib/swarmSocketServer.o /home/pi/csr-repository/CommunicationLib/swarmSocketClient.o /home/pi/csr-repository/CommunicationLib/Network.o $(CFLAGS)

clean:	
	rm -f *.o
